//
//  HEIMImageItemCell.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/11/28.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEIMImageItemCell.h"

@interface HEIMImageItemCell ()


@end

@implementation HEIMImageItemCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self initUI];
    }
    return self;
}

- (void)initUI {
    _imgView = [UIImageView new];
    _imgView.contentMode = UIViewContentModeScaleAspectFill;
    _imgView.clipsToBounds = YES;
    [self.contentView addSubview: _imgView];
 
    [_imgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView);
        make.left.equalTo(self.contentView);
        make.right.equalTo(self.contentView);
        make.bottom.equalTo(self.contentView);
    }];
}

- (void)setImage:(HEIMImageObject *)image {
    _image = image;
    [_imgView sd_setImageWithURL:image.url placeholderImage:IMAGE_NAMED(@"noImage")];
}

@end
